﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace GameStudio.Common.DocView
{
    public class ViewsCollection :  Collection<IView>
    {
        public event EventHandler ItemAdded;
        public event EventHandler ItemRemoved;

        protected override void InsertItem(int index, IView item)
        {
            base.InsertItem(index, item);

            if (ItemAdded != null)
                ItemAdded(this, EventArgs.Empty);
        }

        protected override void RemoveItem(int index)
        {
            base.RemoveItem(index);

            if (ItemRemoved != null)
                ItemRemoved(this, EventArgs.Empty);
        }
    }
}
